
/**
 * Fetches the new page and puts it inline.
 * @param id 		- The element id whose contents will get replaced
 * @param viewUrl	- The URL for the new page
 * @param page		- The page number to request 
 */
function fetchPage(id, viewUrl, page,i) {
	var dataString = "page="+page+"&id="+id+"&divid="+i;
	var Url= viewUrl+"/"+id;
		
	$.ajax({  
			type: "POST",  
			url: Url,  
		    data: dataString,  
				  success: function(resp){ 
		
		document.getElementById("ajax_content"+i).innerHTML  = resp;
				 	
					 },  

			 });  
}


function loadPage(viewUrl,val)
{
	var nid=document.getElementById('search').value;
	var dataString = "nid="+nid;
	
	var Url= viewUrl+"/"+nid+"/"+val;
	
	$.ajax({  
			type: "POST",  
			url: Url,  
		    data: dataString,  
				  success: function(resp){ 	
		document.getElementById('queslist').innerHTML="";
				
		document.getElementById('queslist').innerHTML  = resp;
				 	
					 },  

			 });  
}